<template>
	<view class="">
		<view class="v-home-page" :style="{ '--bg-image': `url(${ dlkm})` }">
			<view :style="{ height: navTop + 'px' }"></view>

			<view class="flex-start-center " style="color:#333333" @click="backNav()">

				<uni-icons style="margin-top: 7rpx;" color="#333333" type="left" size="20"></uni-icons>
				<text style="color: 333333;font-size: 33rpx;"> 代理管理登录</text>
			</view>






		</view>
		<view class="bg">

			<view class="card margin-bottom_50rpx">
				<view class="myNmae">

					<view class="">
						<input class="uni-inputsa"  type="number" v-model="form.account"
							placeholder="请输入账号" />
					</view>


				</view>

			</view>

			<view class="card margin-bottom_50rpx">
				<view class="myNmae">

					<view class="">
						<input class="uni-inputsa" password type="text" v-model="form.password" placeholder="请输入密码" />
						
					</view>


				</view>



			</view>

				<radio-group name="apply" class="radioText flex-start-center" @click="checkedOn2()">
					<label @click.stop="checkedOn2()">
						<radio :checked="agreeChecked" value="1" color="#1890ff"
							style="transform:scale(0.8);padding-left:12rpx;" />
					</label>
					<view class="agree flex-align-center">
						<view style="color: #1890ff;">记住密码</view>
				
					</view>
					
				</radio-group>
				
				
			

			<view class="PublishTags flex" @click="videoNumBtn()">
				确定
			</view>

		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navTop: '',
				materialBg: this.$imgs.mineBgFives,
				dlkm:this.$imgs.dlkm,
				agreeChecked: false,
				modPassword:'',
				form: {
					account: '',
					password: ''
				}

			}
		},
		onLoad() {
			const app = getApp();
			this.navTop = app.globalData.navTop;


			if(uni.getStorageSync('login').account){
				this.$sun.assignObject(this.form, {
					...uni.getStorageSync('login')
				})
				this.agreeChecked=true
			}

		},
		computed: {


		},
		methods: {
		

			backNav() {
				this.$sun.navBack()
			},
			checkedOn2(e) {
				this.agreeChecked = !this.agreeChecked
			},
			async videoNumBtn() {

				if (!this.form.account) {
					this.$sun.toast('请输入账号', 'none')
					return
				}
				if (!this.form.password) {
					this.$sun.toast('请输入密码', 'none')
					return
				}

				const result = await this.$http.get({
					url: this.$api.login,
					data: {
						account: this.form.account,
						password: this.form.password
					}
				});
				if (result.errno == 0) {
					if (this.agreeChecked) {
						uni.setStorageSync('login', this.form)
					}
					uni.setStorageSync('partner_id',result.data)
					this.$sun.toast(result.message, 'none')
					setTimeout(()=>{
						this.$sun.navGo('/pages/contactUs/cardEncryptionRecord')
					},500)

				} else {
					this.$sun.toast(result.message, 'none')
				}



			}

		}
	}
</script>

<style lang="less">
	.v-home-page {
		background-image: (var(--bg-image));
		background-repeat: no-repeat;
		background-size: cover;
		position: relative;
		height: 484rpx;
		padding: 20rpx;

	}

	.bg {
		position: relative;
		z-index: 999;
		// width: 758rpx;
		height: 1200rpx;
		border-radius: 20rpx;
		margin-top: -40rpx;
		background: rgb(255, 255, 255);
		padding: 40rpx;

		.PublishTags {
			z-index: 99;
			margin-top: 10rpx;
			height: 102rpx;
			border-radius: 20rpx;
			color: #fff;


			bottom: 20rpx;
			background: #2476ED;
		}

		.radioText {
			margin: 38rpx 0 38rpx -14rpx;
		}

		.agree {
			color: #666;

			text {
				color: #1890ff;
				// color: #19c866;
			}
		}


		.myNmae {

			background-color: #fff;
			min-width: 50rpx;

			.avatar {
				width: 84rpx;
				height: 84rpx;
			}

			input {
				text-align: left;
			}

			.uni-input {

				height: 100rpx;
			}

			.uni-inputsa {
				width: 94%;
				height: 90rpx;
				border-radius: 20rpx;
				background: rgb(245, 245, 245);
				margin: 20rpx 0;
				padding: 0rpx 20rpx;
			}

			.uni-inputs {
				text-align: left !important;
			}

			.backgroundImg {

				height: 154rpx;


			}

		}
	}
</style>